package servlets;

import java.io.IOException;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringEscapeUtils;


@SuppressWarnings("serial")
public class LogoutServlet extends HttpServlet{
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		HttpSession s = req.getSession(true);
		String o = StringEscapeUtils.escapeHtml3((String) s.getAttribute("email"));
		if(o != null){
			s.removeAttribute("email");
		}
        resp.sendRedirect("/accueil.html");

	}
}
